package com.cloud.message.constant;

import com.cloud.common.bean.ResultInfo;
import lombok.Getter;

public enum ErrorEnum {

    CONSUMER_EXIST(600, "消费者已存在");


    @Getter
    private int code;

    @Getter
    private String message;

    public <T> ResultInfo<T> resultInfo() {
        return ResultInfo.failure().setCode(code).setMessage(message);
    }

    ErrorEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
